﻿@namespace Microsoft.FluentUI.AspNetCore.Components
@inherits FluentComponentBase

@if (Count.HasValue && Count != 0 || ShowZero && Count == 0 )
{
    <div class="counterbadge-container">
        @ChildContent
        @if (Count.HasValue || BadgeContent != null)
        {
            @* 
                Need to write Badge and BadgeContent on the same line 
                to use :empty' css correctly.
            *@
            string? text = Count.ToString();
            if (Count > Max)
            {
                text = $@"{Max}{(ShowOverflow ? "+" : "")}";
            }
            <div class="@ClassValue" style="@StyleValue" title="@Count">@text@BadgeContent</div>
        }
    </div>
}